<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
  <th:block th:include="include :: header('表格数据')" />
</head>
<body class="gray-bg">
<div class="container-div" style="background: #fff">
  <div class="col-sm-12 search-collapse">
    <form id="cxselect-form">
      <div class="select-list">
        <ul id="element">
          <li>
            <label>选择单位：</label>
            <input type="text" name="taskName"/>
          </li>

          <li>
            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('cxselect-form')"><i class="fa fa-refresh"></i>&nbsp;重置</a>
          </li>

          <li>

          </li>
        </ul>
      </div>
    </form>

  </div>
  <div style="background: #fff"  class="row">
    <div class="col-lg-6 col-sm-6 col-md-6" style="background: #fff;padding: 10px;display: inline-block">
      <div style="background: #fff;color:#000;font-weight: bold;font-size: 16px">选择任务</div>
      <div class="box box-main">
        <div class="ui-layout-content">
          <div id="tree" class="ztree"></div>
        </div>
      </div>
    </div>
    <div class="col-lg-6 col-sm-6 col-md-6" style="background: #fff;padding: 10px;display: inline-block">
      <div style="background: #fff;color:#000;font-weight: bold;font-size: 16px">选择子任务</div>
      <div class="form-group">

        <div>
          <div class="checkbox">
            <label>
              <input type="checkbox" value="">选项1</label>
          </div>
          <div class="radio">
            <label>
              <input type="radio" checked="" value="option1" id="optionsRadios1" name="optionsRadios">选项1</label>
          </div>
          <div class="radio">
            <label>
              <input type="radio" value="option2" id="optionsRadios2" name="optionsRadios">选项2</label>
          </div>
        </div>
      </div>
    </div>
    <div style="background: #fff;display: block" >
      <div  class="col-lg-12 col-sm-12 col-md-12"><button type="button" class="btn btn-w-m btn-success">确定合并</button></div>
    </div>
  </div>

</div>
<div th:include="include :: footer"></div>
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: layout-latest-js" />
<th:block th:include="include :: ztree-js" />
<script th:inline="javascript">
  var prefix = ctx + "demo/table";
  var datas1 = [[${@dict.getType('sys_task_type')}]];
  var datas2 = [[${@dict.getType('sys_audit_method')}]];
  var datas3 = [[${@dict.getType('sys_task_status')}]];

  //任务执行人
  var executor=[]
  var enclosure=[]
  $(function() {
    queryDeptTree();
  });

  // function queryDeptTree() {
  //   var url = ctx + "gs/company/selectExecutor";
  //   var options1 = {
  //     url: url,
  //     expandLevel: 2,
  //     onClick:zOnClick
  //   };
  //   function zOnClick(event, treeId, treeNode) {
  //     var node=0
  //     if (executor.length<1) {
  //       executor.push(treeNode.id)
  //       $("#executor").append("<span style='margin: 0px 5px'>"+treeNode.name+"</span>")
  //     }else{
  //       for (var i=0;i<executor.length;i++){
  //         if (treeNode.id!=executor[i]){
  //           node++
  //         }
  //       }
  //       if (node==executor.length){
  //         executor.push(treeNode.id)
  //         $("#executor").append(treeNode.name)
  //       }
  //     }
  //     console.info(executor)
  //   }
  //   $.tree.init(options1);
  // }
  function queryDeptTree()
  {
    var url = ctx + "system/dept/treeData";
    var options = {
      url: url,
      expandLevel: 2,
      onClick : zOnClick
    };
    $.tree.init(options);
    $.tree.init(options);

    function zOnClick(event, treeId, treeNode) {
      $("#deptId").val(treeNode.id);
      $("#parentId").val(treeNode.pId);
      $.table.search();
    }
  }


  function footerStyle(column) {
    return {
//         	    userBalance: {
//         	        classes: 'class'
//         	    },
      userBalance: {
        css: { color: 'red', 'font-weight': 'normal' }
      }
    }[column.field]
  }
</script>
</body>
</html>